package com.sig.opengl;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;

public class MyGLSurfaceView extends GLSurfaceView {

	public MyGLRenderer _renderer = null;
	
	public float width;
	public float height;

	@Override
	public void onResume(){	 
		super.onResume();
		_renderer.onResume();
	}
	
	public MyGLSurfaceView(Context context, AttributeSet attrs)
	{
		super(context, attrs);
		creer();
	}

	public MyGLSurfaceView(Context context) {
		super(context);
		creer();
	}

	public MyGLRenderer getRenderer(){
		return _renderer;
	}

	private void creer(){
		setEGLContextClientVersion(2);

		_renderer = new MyGLRenderer();
		setRenderer(_renderer);

		setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
	}

	boolean bite = false;	

	/*
	@Override
	public boolean onTouchEvent(MotionEvent e) {
		switch (e.getAction()) {
		case MotionEvent.ACTION_DOWN:
			  if(!bite){
				Forme.ajouterBite(_renderer._formes);
				bite = true;
			}
			break;
			
		case MotionEvent.ACTION_MOVE:
			_renderer.rotate(e.getX(), e.getY(),this);
			requestRender();
			break;
		}

		return true;
	}
	*/

}
